<template>
  <section>
    <el-form inline>
      <el-form-item v-for="f in form" :key="f.code" :label="f.title">
        <el-input size="mini" v-model="f.val"></el-input>
      </el-form-item>
    </el-form>
    <el-button size="mini" @click="saveNode" type="success">保存</el-button>
    <el-button size="mini" @click="delNode" type="danger">删除</el-button>
  </section>
</template>

<script>
  import {mapGetters, mapActions, mapMutations} from 'vuex'
  import Vue from 'vue'//后续添加属性，需要vue联动
  import dateFormater from '@/common/date-formater'
  import errHandler from '@/assets/errHandler'
  export default {
    name: "judgeAge",
    props: ['node'],
    data() {
      return {
        form:null
      }
    },
    created(){
      if(this.node.nodeJson){
        this.form=JSON.parse(this.node.nodeJson)
      }else {
        this.form=this.node.activityProperties.data.detail
      }
    },
    computed:{
    },
    watch: {
    },
    methods: {
      ...mapActions({
        fetch: 'fetch'
      }),
      saveNode(){
        this.node.nodeJson=JSON.stringify(this.form)
        this.$emit('save')
      },
      delNode(){
        this.$emit('del')
      }
    }
  }
</script>

<style scoped>

</style>
